namespace ZFramework.Runtime
{
    public class OpenUIFormSuccessEventArgs : GameEventArgs
    {
        public static int EventId = typeof(OpenUIFormSuccessEventArgs).GetHashCode();

        public override int Id
        {
            get { return EventId; }
        }

        public IUIForm UiForm { get; private set; }

        public float Duration { get; private set; }

        public object UserData { get; private set; }

        public static OpenUIFormSuccessEventArgs Create(IUIForm uiForm, float duration, object userData)
        {
            var args = ReferencePool.Acquire<OpenUIFormSuccessEventArgs>();
            args.UiForm = uiForm;
            args.Duration = duration;
            args.UserData = userData;
            return args;
        }

        public override void Clear()
        {
            UiForm = null;
            Duration = 0f;
            UserData = null;
        }
    }
}
